package me.leiusual.sharing.ui.mine

import androidx.lifecycle.ViewModel
import dagger.Binds
import dagger.Module
import dagger.android.ContributesAndroidInjector
import dagger.multibindings.IntoMap
import me.leiusual.sharing.di.FragmentScope
import me.leiusual.sharing.di.ViewModelKey

/**
 * Create by leiusual on 2018/8/14
 */
@Module
abstract class MineModule {

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun mineAddressEditFragment(): MineAddressEditFragment

  @Binds
  @IntoMap
  @ViewModelKey(MineAddressEditViewModel::class)
  abstract fun mineAddressEditViewModel(mineAddressEditViewModel: MineAddressEditViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun mineAddressFragment(): MineAddressFragment

  @Binds
  @IntoMap
  @ViewModelKey(MineAddressViewModel::class)
  abstract fun mineAddressViewModel(mineAddressViewModel: MineAddressViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun mineAuthFragment(): MineAuthFragment

  @Binds
  @IntoMap
  @ViewModelKey(MineAuthViewModel::class)
  abstract fun mineAuthViewModel(mineAuthViewModel: MineAuthViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun mineHomeFragment(): MineHomeFragment

  @Binds
  @IntoMap
  @ViewModelKey(MineHomeViewModel::class)
  abstract fun mineHomeViewModel(mineHomeViewModel: MineHomeViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun mineInfoFragment(): MineInfoFragment

  @Binds
  @IntoMap
  @ViewModelKey(MineInfoViewModel::class)
  abstract fun mineInfoViewModel(mineInfoViewModel: MineInfoViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun mineInvitedFragment(): MineInvitedFragment

  @Binds
  @IntoMap
  @ViewModelKey(MineInvitedViewModel::class)
  abstract fun mineInvitedViewModel(mineInvitedViewModel: MineInvitedViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun mineInviteFragment(): MineInviteFragment

  @Binds
  @IntoMap
  @ViewModelKey(MineInviteViewModel::class)
  abstract fun mineInviteViewModel(mineInviteViewModel: MineInviteViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun mineMessageFragment(): MineMessageFragment

  @Binds
  @IntoMap
  @ViewModelKey(MineMessageViewModel::class)
  abstract fun mineMessageViewModel(mineMessageViewModel: MineMessageViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun mineMobileFragment(): MineMobileFragment

  @Binds
  @IntoMap
  @ViewModelKey(MineMobileViewModel::class)
  abstract fun mineMobileViewModel(mineMobileViewModel: MineMobileViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun mineNicknameFragment(): MineNicknameFragment

  @Binds
  @IntoMap
  @ViewModelKey(MineNicknameViewModel::class)
  abstract fun mineNicknameViewModel(mineNicknameViewModel: MineNicknameViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun mineRenewFragment(): MineRenewFragment

  @Binds
  @IntoMap
  @ViewModelKey(MineRenewViewModel::class)
  abstract fun mineRenewViewModel(mineRenewViewModel: MineRenewViewModel): ViewModel
}